<?php
$matkul=35;
$jadwal=30;
for($a=1;$a<=$matkul;$a++)
	{
	$cek[$a]=mt_rand(1, 30);
	echo $cek[$a].";";
	}
echo "<br/>\n";

?>
<form name='lempar' method='POST' action='test10.php'>
<?php
for($urut_f=1;$urut_f<=$jadwal;$urut_f++){
$urutp=1;
$urutpp=0;
	for($urut_ff=1;$urut_ff<=$matkul;$urut_ff++){
		if($cek[$urut_ff]==$urut_f){
		$urutpp++;
		echo $urutp;
		echo "<input type='hidden' name='probe".$urut_f,$urutpp."' id='probe".$urut_f,$urutpp."' value='";
		echo $urutp;
		echo "'>\n";
		}
	$urutp++;
	}
$j_urut[$urut_f]=$urutpp;
}
echo "<br/>";
for($urut_f=1;$urut_f<=$jadwal;$urut_f++){
echo "<input type='hidden' name='jprobe".$urut_f."' id='jprobe".$urut_f."' value='";
echo $j_urut[$urut_f];
echo "'>\n";
}

?>
<input type='submit' value='Simpan'>
</form>


<?php
echo "<table border='1'>";
for($urut_f=1;$urut_f<=$matkul;$urut_f++){
$jj=$_POST["jprobe$urut_f"];
if ($urut_f<=3){echo "<tr><td>Senin1</td><td>".$urut_f%3 ."</td><td>";}
elseif ($urut_f<=6){echo "<tr><td>Selasa1</td><td>".$urut_f%3 ."</td><td>";}
elseif ($urut_f<=9){echo "<tr><td>Rabu1</td><td>".$urut_f%3 ."</td><td>";}
elseif ($urut_f<=12){echo "<tr><td>Kamis1</td><td>".$urut_f%3 ."</td><td>";}
elseif ($urut_f<=15){echo "<tr><td>Jumat1</td><td>".$urut_f%3 ."</td><td>";}
elseif ($urut_f<=18){echo "<tr><td>Senin2</td><td>".$urut_f%3 ."</td><td>";}
elseif ($urut_f<=21){echo "<tr><td>Selasa2</td><td>".$urut_f%3 ."</td><td>";}
elseif ($urut_f<=24){echo "<tr><td>Rabu2</td><td>".$urut_f%3 ."</td><td>";}
elseif ($urut_f<=27){echo "<tr><td>Kamis2</td><td>".$urut_f%3 ."</td><td>";}
elseif ($urut_f<=30){echo "<tr><td>Jumat2</td><td>".$urut_f%3 ."</td><td>";}

	for($jj2=1;$jj2<=$jj;$jj2++){
	echo $_POST["probe$urut_f$jj2"]."<br/>";
	}
echo "</td></tr>";
}
echo "</table>";
?>













